﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using BUS;

namespace QuanLyHocSinh.GUI
{
    public partial class F_QuanLyQuiDinh : DevExpress.XtraEditors.XtraUserControl
    {
        public F_QuanLyQuiDinh()
        {
            InitializeComponent();
        }

        private void F_QuanLyQuiDinh_Load(object sender, EventArgs e)
        {
            this.txtTuoiToiThieu.Text = BUS.GlobalVariableBUS.TuoiMin.ToString();
            this.txtTuoiToiDa.Text = BUS.GlobalVariableBUS.TuoiMax.ToString();
            this.txtDiemDat.Text = "5";
            this.txtSoLuongDatMon.Text = "10";
        }

        private void simpleButton1_Click(object sender, EventArgs e)
        {
            BUS.GlobalVariableBUS.TuoiMin = int.Parse(txtTuoiToiThieu.Text);
            BUS.GlobalVariableBUS.TuoiMax = int.Parse(txtTuoiToiDa.Text);
            XtraMessageBox.Show("Đã Thay Đổi Qui Định Thành Công!");
        }

        private void txtTuoiToiThieu_KeyPress(object sender, KeyPressEventArgs e)
        {
            GlobalFunction.KhongChoPhepNhapKiTu(e);
        }

        private void txtTuoiToiDa_KeyPress(object sender, KeyPressEventArgs e)
        {
            GlobalFunction.KhongChoPhepNhapKiTu(e);
        }

        private void txtDiemDat_KeyPress(object sender, KeyPressEventArgs e)
        {
            GlobalFunction.KhongChoPhepNhapKiTu(e);
        }

        private void txtSoLuongDatMon_KeyPress(object sender, KeyPressEventArgs e)
        {
            GlobalFunction.KhongChoPhepNhapKiTu(e);
        }
    }
}
